package com.aiyige.arouter;

import com.aiyige.arouter.config.ARouterConfig;

/**
 * Created by xiachao on 2017/12/20.
 */

public enum RouterEnum {
    page_goodsDetail("goodsDetail", ARouterConfig.DetailPage);

    private String routerKey;

    private String routerPage;

    RouterEnum(String routerKey, String routerPage) {
        this.routerKey = routerKey;
        this.routerPage = routerPage;
    }

    /**
     * 根据key获取value
     *
     * @param key
     *            : 键值key
     * @return String
     */
    public static String getValueByKey(String key) {
        RouterEnum[] enums = RouterEnum.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].routerKey.equals(key)) {
                return enums[i].routerPage;
            }
        }
        return "";
    }

}
